<head th:fragment="headerCss">
    <meta charset="utf-8">
    <title>证书详情</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta name="keywords" content=""/>
    <meta name="description"
          content="证书详情"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="/js/layui/css/layui.css">
    <!-- Bootstrap CSS File -->
    <!--<link href="/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">-->
    <link rel="stylesheet" href="/css/certificateQuery/common.css">
    <link rel="shortcut icon" href="favicon.ico">
    <style>
        .certificate-box{
            position: relative;
        }
        .detail-box{
            padding: 0 15px 0 15px;
            position: relative;
            top: -60px;
        }
        .detail{
            box-shadow: 0px 3px 10px 1px rgba(0,0,0,0.08);
            border-radius: 8px;
            background: #FFFFFF;
            padding: 24px;
            text-align: center;
            font-size: 15px;
        }
        .items{
            display: flex;
            display: -moz-flex;
            display: -webkit-flex;
            align-items: baseline;
            -webkit-align-items: baseline;
            -moz-align-item:baseline;
            border-bottom: 1px solid #F2F2F2;
            padding: 16px 0;
        }
        .detail img{
            margin-bottom: 24px;
        }
        .content{
            text-align: left;
            margin-left: 12px;
            flex: 1;
            -webkit-flex: 1;
            -moz-box-flex: 1;
        }
    </style>
</head>
<body class="signin">
<div class="certificate-box">
    <img src="/img/certificateQuery/bg1.png" style="width: 100%">
    <div class="detail-box">
        <div class="detail">
            <img  th:src="${newTrainingCertificatesDO.stuImg}" width="79" height="118">
            <div class="items">
                <div class="tit fl">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</div>
                <div class="content fl" th:text="${newTrainingCertificatesDO.name}"></div>
            </div>
            <div class="items">
                <div class="tit fl">证件类型：</div>
                <div class="content fl" th:text="${newTrainingCertificatesDO.idNumberType}">居民身份证</div>
            </div>
            <div class="items">
                <div class="tit fl">证件号码：</div>
                <div class="content fl" th:text="${newTrainingCertificatesDO.idNumber}"></div>
            </div>
            <div class="items">
                <div class="tit fl">职业名称：</div>
                <div class="content fl" th:text="${newTrainingCertificatesDO.type}"></div>
            </div>
            <div class="items">
                <div class="tit fl">证书编号：</div>
                <div class="content fl" th:text="${newTrainingCertificatesDO.numbers}"></div>
            </div>
            <div class="items">
                <div class="tit fl">发证日期：</div>
                <div class="content fl" th:text="${#dates.format(newTrainingCertificatesDO.getTime, 'yyyy-MM-dd')}"></div>
            </div>
            <div class="items">
                <div class="tit fl">发证机构：</div>
                <div class="content fl">
                    <p class="issuingUnit"></p>
                    <p class="oneUnit"></p>
                </div>
                <input type="hidden" class="unitNames" th:value="${newTrainingCertificatesDO.issuingUnit}">
            </div>
        </div>
    </div>
</div>
<script src="/js/jquery.min.js?v=2.1.4"></script>

<script type="text/javascript">
    //回车查询
    var examinationListIntro = null;
    document.onkeydown =cdk;
    function cdk(){
        if(event.keyCode ==13){
            query();
        }
    }
    var id=null;

    let issuingUnit = $('.unitNames').val().split(',');
    $(".issuingUnit").html(issuingUnit[0])
    $(".oneUnit").html(issuingUnit[1])


    $(function () {
    });
    function query() {
        var certificateNumber = $("#certificateNumber").val();
        var idNumber = $("#idNumber").val();
        var name = $("#name").val();
        $.ajax({
            type: "GET",
            url:"/jzApi/ApiTrainCertificateController/getUserCertificate",
            data: {certificateNumber:certificateNumber,name:name , idNumber:idNumber},
            success: function (r) {
                console.log("map =" , r.data[0]);

                if(r.code==0){
                    var result = r.data[0];
                    location.href = '/certificate/queryResult?certificateNumber='+result.certificateNumber+
                        "&courseTitle="+result.courseTitle+"&getTime="+result.getTime+"&grade="+result.grade+
                        "&idNumber="+result.idNumber+"&img="+result.img+"&name="+result.name+"&period="+result.period+
                        "&sex="+result.sex+"&type="+result.type+"&unit="+result.unit;
                }else{
                    alert(r.msg);
                }
            }
        });
    }
</script>
</body>





